#include "widget.h"
#include "ui_widget.h"
#include"teacher.h"
#include"student.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    this->tch=new Teacher(this);
    this->stu=new Student(this);

    QPushButton *btn=new QPushButton("上课啦",this);
    resize(800,600);
    btn->move(100,100);

    connect(tch,&Teacher::MySignal,stu,&Student::StartStudy);

    connect(btn,&QPushButton::clicked,tch,&Teacher::MySignal);
    EmitSignal();
}

void Widget::EmitSignal()
{
    emit tch->MySignal();
}
Widget::~Widget()
{
    delete ui;
}

